<html><head><title>TrySemaphore</title></head>
<body bgcolor="#EFF1F0" link="#3A3966" vlink="#000000" alink="#000000">
<font face="Verdana, sans-serif" size="2"><p align="center"><b><font size="4">TrySemaphore()</font></b></p>
<p><b>Syntax</b></p><blockquote>
Result = <font color="#3A3966"><b>TrySemaphore</b></font>(Semaphore)</blockquote>

</blockquote>
<b>Description</b><br><blockquote>

Decreases the internal count of the semaphore by one only if the count is above 0. This is the same 
as a <a href="waitsemaphore.html">WaitSemaphore()</a> operation, but without blocking if the count would fall below 0. 

</blockquote><p><b>Parameters</b></p><blockquote>
<style type="text/css">
table.parameters { border-spacing: 0px; border-style: none; border-collapse: collapse; }
table.parameters td { border-width: 1px; padding: 6px; border-style: solid; border-color: gray; vertical-align: top; font-family:Arial; font-size:10pt; }
</style>
<table width="90%" class="parameters">
<tr><td width="10%"><i>Semaphore</i></td>
<td width="90%"> 
The semaphore to use. 

</td></tr>
</table>
</blockquote><p><b>Return value</b></p><blockquote>

Nonzero if the semaphore count was decreased, or zero if the count could not be decreased because 
it was already zero. 

</Blockquote><p><b>Supported OS </b><Blockquote>All</Blockquote></p><center><- <a href=trylockmutex.html>TryLockMutex()</a> - <a href="index.html">Thread Index</a> - <a href="unlockmutex.html">UnlockMutex()</a> -><br><br>
</body></html>